/*package test;


import office.Office;
import report.Appointment;
import report.Invoice;
import report.LabWork;
import report.Report;
import report.Symptoms;
import report.Treatment;
import report.VitalSigns;
import users.AccessLevel;
import users.UserList;
import junit.framework.TestCase;
import log_error.UserException;

/**
 * @author Earle Harrison
 *
 */
/*
public class Testupdatelab extends TestCase {
	
	 public void initAdmin() {

			try {
			    UserList.clear();
			    UserList.addUser("admin", "admin", "admin", "admin1",
				    AccessLevel.ADMIN);
			} catch (UserException e) {
			}
		    }
	
	 public void testLabUpdate() throws Exception {
			initAdmin();
			Office oTest = new Office();

			oTest.uLogin("admin", "admin1");
			oTest.addUser("Test", "Nurse", "nur1", "1pass", AccessLevel.NURSE);
			oTest.addUser("Test", "Patient", "pat1", "1pass", AccessLevel.PATIENT);
			oTest.addUser("Test", "Doctor", "doc1", "1pass", AccessLevel.DOCTOR);
			oTest.uLogout();

			// add an appointment
			oTest.uLogin("pat1", "1pass");
			oTest.addSelfAppointment(0, 100, 0);
			oTest.uLogout();

			oTest.uLogin("nur1", "1pass");
			oTest.searchForName("Test", "Patient");
			Appointment tempAppt = oTest.getWaitingAppointments().get(0);
			oTest.confirmSearchUserAppointment(tempAppt);
			tempAppt = oTest.getSearchUserAppointments().get(0);
			
			Symptoms mySymptoms = new Symptoms(
			"Runny nose, hurting back, caughing.");
		VitalSigns mySigns = new VitalSigns(120, 80, 101.5, 70, 175, 169);
		// Create a report
		Report myReport = new Report(mySymptoms, mySigns, null, tempAppt
			.getDay(), 1337.7, tempAppt.getPatientID(), tempAppt
			.getDoctorID(), null);
		tempAppt.setReport(myReport);
		
		Treatment[] treatments = new Treatment[3];
		myReport.setTreatments(treatments);
		
		LabWork lab_work1 = new LabWork(null, null, 0, null, 0, null, null);
		LabWork lab_work2 = new LabWork(null, null, 0, null, 0, null, null);
		LabWork lab_work3 = new LabWork(null, null, 0, null, 0, null, null);
		
		treatments[0] = lab_work1;
		treatments[1] = lab_work2;
		treatments[2] = lab_work3;
		
		myReport.setTreatments(treatments);

		oTest.updateSearchUserAppointment(tempAppt);
		oTest.uLogout();
		
		// add lab works
		
		oTest.uLogin("nur1", "1pass");
		
		lab_work1.setNurse("Nurse Cindy");
		lab_work1.setCost(100);
		lab_work1.setDoctor("Dr. Smith");
		lab_work1.setDueDate(12032011);
		lab_work1.setPatient("Bill Bob");
		lab_work1.setInstructions("Kill the grems");
		lab_work1.setType("Blood");
		
		lab_work2.setNurse("Nurse Julie");
		lab_work2.setCost(50);
		lab_work2.setDoctor("Dr. John");
		lab_work2.setDueDate(12032009);
		lab_work2.setPatient("Jim Joe");
		lab_work2.setInstructions("Kill the grems");
		lab_work2.setType("Organ");

		lab_work3.setNurse("Nurse Sue");
		lab_work3.setCost(150);
		lab_work3.setDoctor("Dr. Bill");
		lab_work3.setDueDate(12222012);
		lab_work3.setPatient("Kevin Smith");
		lab_work3.setInstructions("Anaylze");
		lab_work3.setType("Blood");
		oTest.updateSearchUserAppointment(tempAppt);
		oTest.uLogout();
		
		//test if lab works are set
		oTest.uLogin("pat1", "1pass");
		
		Treatment[] tempAppt2 = oTest.getSearchUserAppointments().get(0).getReport().getTreatments();
		
		assertEquals(100.0, tempAppt2[0].getCost());
    	assertEquals("Dr. John",((LabWork)tempAppt2[1]).getDoctor() );
    	assertEquals("Nurse Sue",((LabWork)tempAppt2[2]).getNurse());
    	assertEquals(12222012,((LabWork)tempAppt2[2]).getDueDate());
    	assertEquals("Organ",((LabWork)tempAppt2[1]).getType());
    	oTest.uLogout();
		
		//updating lab works
    	
    	oTest.uLogin("nur1", "1pass");
    	lab_work1.updateLabWork(lab_work1);
    	lab_work2.updateLabWork(lab_work3);
    	lab_work3.updateLabWork(lab_work1);
    	oTest.updateSearchUserAppointment(tempAppt);
		oTest.uLogout();
		
		//testing updateLabWork
		oTest.uLogin("pat1", "1pass");
		assertEquals(100.0, tempAppt2[0].getCost());
    	assertEquals("Dr. Bill",((LabWork)tempAppt2[1]).getDoctor() );
    	assertEquals("Nurse Cindy",((LabWork)tempAppt2[2]).getNurse());
    	assertEquals(12032011,((LabWork)tempAppt2[2]).getDueDate());
		oTest.uLogout();
		
		//setting things to null and zero
		oTest.uLogin("nur1", "1pass");
    	
		lab_work1.setCost(0);
		lab_work1.setDoctor(null);
    	lab_work1.setInstructions(null);
		
    	lab_work2.setInstructions(null);
		lab_work2.setDueDate(0);
		lab_work2.setNurse(null);
		lab_work2.setType(null);
		
		lab_work3.setDoctor(null);
		lab_work3.setNurse(null);
		lab_work3.setCost(0);
    	
    	oTest.updateSearchUserAppointment(tempAppt);
		oTest.uLogout();

		//updating changes
		oTest.uLogin("nur1", "1pass");
    	lab_work1.updateLabWork(lab_work1);
    	lab_work2.updateLabWork(lab_work2);
    	lab_work3.updateLabWork(lab_work3);
    	oTest.updateSearchUserAppointment(tempAppt);
		oTest.uLogout();
		
		//testing for any changes
		oTest.uLogin("pat1", "1pass");
		assertEquals(0.0, tempAppt2[0].getCost());
    	assertEquals(null,((LabWork)tempAppt2[1]).getInstructions());
    	assertEquals(null,((LabWork)tempAppt2[2]).getNurse());
    	assertEquals(0,((LabWork)tempAppt2[1]).getDueDate());
		oTest.uLogout();
		
		//creating changes to lab_work3 and lab_work2
		oTest.uLogin("nur1", "1pass");
		lab_work3.setDueDate(8221990);
		lab_work2.setDueDate(3171995);
		lab_work3.setInstructions("Take Blood Sample");
		lab_work2.setInstructions("Take Tissue Sample");
		lab_work3.setNurse("Nurse Mia");
		lab_work2.setNurse("Nurse Betrix");
		lab_work3.setPatient("Mike Myers");
		lab_work2.setPatient("Cher");
		oTest.updateSearchUserAppointment(tempAppt);
		oTest.uLogout();
    	
		oTest.uLogin("nur1", "1pass");
		lab_work3.updateLabWork(lab_work2);
    	oTest.updateSearchUserAppointment(tempAppt);
		oTest.uLogout();
		
		//testing for any changes
		oTest.uLogin("pat1", "1pass");
		assertEquals(3171995, tempAppt2[2].getDueDate());
    	assertEquals("Take Tissue Sample",((LabWork)tempAppt2[2]).getInstructions());
    	assertEquals("Nurse Betrix",((LabWork)tempAppt2[2]).getNurse());
    	assertEquals("Cher",((LabWork)tempAppt2[2]).getPatient());
		oTest.uLogout();
		
		//updating a lab work to one which has been just updated
		oTest.uLogin("nur1", "1pass");
		lab_work1.setCost(300);
		lab_work1.setInstructions("Clean the Sample");
		lab_work1.setNurse("Nurse Yuki");
		lab_work3.updateLabWork(lab_work1);
		lab_work2.updateLabWork(lab_work3);
    	oTest.updateSearchUserAppointment(tempAppt);
		oTest.uLogout();
		
		//testing for any changes
		oTest.uLogin("pat1", "1pass");
		assertEquals(300.0, tempAppt2[1].getCost());
    	assertEquals("Clean the Sample",((LabWork)tempAppt2[1]).getInstructions());
    	assertEquals("Nurse Yuki",((LabWork)tempAppt2[1]).getNurse());
		oTest.uLogout();
	 }
}
*/
